package com.jy.modules.cims.quota.service;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jy.modules.cims.common.sysUtils.SearchParamUtil;
import com.jy.modules.cims.data.common.dto.TCMmCostPlanDTO;
import com.jy.modules.cims.data.dao.CostPlanDao;
import com.jy.modules.cims.data.dao.QuotaEstimateDao;
import com.jy.modules.cims.data.dto.CreditDetailQueryDto;
import com.jy.modules.cims.data.dto.QuotaEstimateDto;

@Service("com.jy.modules.cims.quota.service.QuotaEstimateService")
public class QuotaEstimateService {

	
	 @Autowired
	 private QuotaEstimateDao quotaEstimateDao;
	 
	 @Autowired
	 private CostPlanDao costPlanDao ;
	
	public List<QuotaEstimateDto> searchQuotaEstimateDtoByPaging(Map<String, Object> searchParams){
		return quotaEstimateDao.searchQuotaEstimateDtoByPaging(searchParams);
	}
	
	public List<QuotaEstimateDto> exportQuotaEstimateDtoList(Map<String, Object> searchParams){
		return quotaEstimateDao.exportQuotaEstimateDtoList(searchParams);
	}
	
	public List<QuotaEstimateDto> getQuotaEstimateDtoSum(Map<String, Object> searchParams){
		return 	quotaEstimateDao.getQuotaEstimateDtoSum(searchParams);
	}
	
	public List<TCMmCostPlanDTO> getCostPlanForSettle(QuotaEstimateDto quotaEstimateDto){
		CreditDetailQueryDto dto = QuotaEstimateDto.toEntity(quotaEstimateDto);
		return  costPlanDao.searchCostPlanForSettle(SearchParamUtil.getSearchParam(dto));
	}
	
}
